/*
 * Copyrignt (c) qkier.com. All Rights Reserved.
 * Author: xuzeshui@qkier.com
 * Created Time: 2017-04-19 11:27:10
 * Last Modified: 2017-04-20 13:43:24
 * File Name: errorcode/msg.go
 * Description:
 */

//
package errorcode

func msgInit() {
	errorMsg = make(map[uint]string)
	errorMsg[EC_GL_SUCCESS] = "成功"
	errorMsg[EC_GL_INVALID_ACCESS_TOKEN] = "无效的access_token，未登录"
	errorMsg[EC_GL_INVALID_APPKEY] = "未授权的appkey"
	errorMsg[EC_GL_INVALID_IP] = "请求者的IP被封禁"
	errorMsg[EC_GL_INVALID_URL_TIME] = "URL时间戳差距过大，拒绝服务"
	errorMsg[EC_GL_INVALID_URL_SIGN] = "URL签名非法"
	errorMsg[EC_GL_INVALID_HTTPS] = "必须是https请求"

	errorMsg[EC_GL_INVALID_JSON_BODY] = "无法解析的body json字符串"
	errorMsg[EC_GL_INVALID_URL_PARAM] = "URL参数非法"

	errorMsg[EC_GL_INTERNAL_ERROR] = "服务器内部错误"

	errorMsg[EC_IP_INVALID_IP] = "IP地址不合法"
	errorMsg[EC_IP_OVER_BATCH_QUERY_MAX_LENGTH] = "超过批量查询的上限"

	errorMsg[EC_GEO_ADDRESS2LOCATION_ERROR] = "地址转坐标失败"
	errorMsg[EC_GEO_LOCATION2ADDR_ERROR] = "坐标转地址失败"
}

func Msg(errcode uint) string {
	if msg, ok := errorMsg[errcode]; ok {
		return msg
	}
	return ""
}
